import service from '@/utils/request';

export const getComponent = params =>
  service({
    url: '/simulation/resourceLibrary/component/',
    method: 'get',
    params,
  });

export const getComponentType = () =>
  service({
    url: '/simulation/resourceLibrary/component/type/',
    method: 'get'
  });

export const getImage = params =>
  service({
    url: '/simulation/resourceLibrary/image/',
    method: 'get',
    params,
  });
// 配置状态检查
export const checkComponent = () =>
  service({
    url: '/simulation/resourceLibrary/component/check/',
    method: 'get',
  });

export const getComputers = uuid =>
  service({
    url: `/simulation/resourceLibrary/component/${uuid}/`,
    method: 'post',
  });

export const saveComputers = (uuid, data) =>
  service({
    url: `/simulation/resourceLibrary/component/${uuid}/`,
    method: 'put',
    data,
  });

export const getEquipmentList = () =>
  service({
    url: `/simulation/resourceLibrary/equipment/`,
    method: 'get',
  });

export const trafficReplay = (id,rid,data) =>
    service({
        url: `/simulation/scene/scene/${id}/instance/${rid}/trafficReplay/`,
        method: 'post',
        data:data
    });
